package org.linlinjava.litemall.core.config;


import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

/**
 * @author zhou
 */
public final class AliPayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String APP_ID = "2017083108472507";

    //卖家支付宝用户号
    public static String SELLER_ID = "2088721878631317";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String RSA_PRIVATE_KEY = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDM9djnU3JDePXozxFQDRBsnXf741/l2qf5TUt0nKb0J3raLbZkx76lOtAJ3vMtSfjRdMSKefEJ5CclQ26B8TBh2x9D6/x7wmLUYRG2dQGOnImyZGXdRQgVfjC9Zq6CsLpDcCtsyDegnBAeUGlCdB9DDLAMkf8+qpeKg30bRsOpAvDU/O0CI9hIPh7aYmPht3bCsp0eE8U1iLZtcFOBo+MJaV/AEtBGK58+RW+l53zElFKriA+kWUAcai7Jb524+5wW9cg0XF2FIxWTkBN3aE5Fq/vyr0bWT9ziNgeRleRDAAqS6DyO8dFBJ82WgB1NZH6Qc4mwC4kSfnM+gKzjbVUzAgMBAAECggEBAIt4/NolwcrCZGzBg+F6kmOnIH/rMVXj3oxame9HrqDUwNf5ZXXdKxGbHPiqm8aE4On/0ML+yhTWCgFkiq2oKClfCD6bNtws4j3ttDT6GE4ondckVOEm2aJuldI9LqHGi2nayeIjuR71NE68n3RWOvPQjXhwXUYSpj7ezWKjXAAExMpvtoE2z/rd/au4orsatzocRG6UBWwAkc9DbPLCrOSfMFwbp/oXLb050n14LyBL2sdAy2TBBhHuxe7g14krflzwsxJ/oBzJ0iAo+7O3nUgzT7umtfYvKTMKAswML/Dt0epSQ+UfLCBy18ag+vz8dqiySn67xelQi9jZOZM3W6kCgYEA9V0iN4d+RFpn56IoYXjZE16PfAF6m2EnwSRB2qbftEWAdeyuR40fFTZU1KKdLAzFpByqNM0/z/kvOaIKFcKRnrrmZHVxvhB7C8a+vwANaBwU0en3cYUinbV3pBA70nlza86yckI8fS6iQMzxpJxgPYQ8CFe7kVZQ0u09DOJhcs8CgYEA1dhYh+JjrCHJYJdzW62xOjkGVrFJXhbRJcflsI00oxc2aFE1XB3QMULAcLjwJ6BOgxkA6bFmg5YDoK/7hc3b0ROTuHomREwi0t8MWjswcCeOFVuTpJacVK65zCIhw1KQ2I8Wn/reV2XtqRErCkzOQF0b/yS3kJwyR9txtKe3YF0CgYA7DXA3xx9nmg6Z3Bg15VzxYXfNE5oLnWVxAaXr1u/ONlAFkbIcPGW3uDzQdFa5jFVg+xkn3iI2jrWD/HDK7eoYNslOckmuwc6rdejglUWkweVs5A+OvckoBc3GqbWMIXjbAINIJpLiWf/o8qpRwOUUySedpmfZQdnv+fMQj8d+VwKBgQDHTVN1kbGDhBnDRGPnVgKPWQZnVeQjJPDYXW3dFj2worm6j7VDnSWkQ6pHZJWu2OFTncIUC5qXmQDYiivJkQsF2VEb5fw0OyFZlzhUAEYswTDTBv6bryMUaaQQdN8yw4jrzLAxegYvPng50h5jAyJXKnAlY3sR9AGIpyVaUdW+oQKBgQDLNKi2+b+NUCBZqpG9QeGsLaeWglKRW1ZhReqpyv7FGSXH171DnV3OrEZH+M0FseMfHb9z2xDxJqk/SSi0v2faVcunzyo6lyDR06sod2dQFJloQ7Y8HjqBcfhFs4lC+97QBTmnFIAHLEkM4GOAjrTy7RszQULBTM54LIGmlGTZsQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlDHljHx0aJs5QkI+AQ/mJqfUOvquq3vC2nHvgoepXUTVpZNmLIMcoxpPyShKRFIkn6D8Hjl1ivigstY01Lompz+86bWqn2nC/JZUkSA19KyhZbYBeNAVKoxKj2sTwTbjNWosWk72BDN8H57RXCuXk/KLjh15yXheav8R9plST1yNz52G8ZXv0neKN2vLbJm0vRSqLPbKdTjaX9ZnUHrLy6PpXcq4EBf5/DK/+0YSjrwcnBJRihu2AHlG+d6AtIr4tiGGyYdJVK0zPXyyVRAlCCAypOZeTUq1Qp5aFn35tJHlStVak6N6hAQloogIv4zQi/BIxmtQVicY3HgaaJ13gwIDAQAB";


    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String NOTIFY_URL = "http://api.ctmingyi.com:8082/wx/order/alipay-notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String RETURN_URL = "你的回调页面";

    // 签名方式
    public static String SIGN_TYPE = "RSA2";

//     签名方式 不需修改
//    public static String sign_type = "RSA";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 返回格式
    public static String FORMAT = "JSON";

    // 支付宝网关
    public static String GATEWAY_URL = "https://openapi.alipay.com/gateway.do";

    //获得初始化的AlipayClient
    private static AlipayClient alipayClient = null;

    /**
     * 双重锁单例
     *
     * @return WechatClient实例
     */
    public static AlipayClient getInstance() {
        if (alipayClient == null) {
            synchronized (AlipayClient.class) {
                if (alipayClient == null) {
                    return new DefaultAlipayClient(GATEWAY_URL, APP_ID, RSA_PRIVATE_KEY, FORMAT, CHARSET, ALIPAY_PUBLIC_KEY, SIGN_TYPE);
                }
            }
        }
        return alipayClient;
    }

    public static String SUCCESS_REQUEST = "TRADE_SUCCESS";
    /**
     * 交易关闭回调(当该笔订单全部退款完毕,则交易关闭)
     */
    public static String TRADE_CLOSED = "TRADE_CLOSED";


}
